/
/ $Header: README.txt 17-jan-2008.14:58:07 rkothuri Exp $
/
/ README.txt
/
/ Copyright (c) 2007, Oracle. All Rights Reserved.
/
/   NAME
/     README.txt - <one-line expansion of the name>
/
/   DESCRIPTION
/     <short description of component this file declares/defines>
/
/   NOTES
/     <other useful comments, qualifications, etc.>
/
/   MODIFIED   (MM/DD/YY)
/   rkothuri    12/06/07 - Readme for KMZ rendering
/   rkothuri    12/06/07 - Creation
/

Description: 
This demo script converts 3D buildings with textures stored in Oracle
schema to KML/KMZ files to be viewed using Google Earth.  
The demo assumes the 3D building information is stored in following tables. 

More information on obtaining data from partners in the format can be
obtained from the OTN page for Oracle Spatial at 
http://www.oracle.com/technology/sample_code/products/spatial/

Building_group_3d: containing 
  bgrp_id: number 
  geom: sdo_geometry  (footprint of building_group)

Each building_group has multiple buildings. Each building has
a roof (stored in building_roof_3d table), and a set of facades 
(stored in a building_facade). Each facade has a geometry extent 
and a texture image to superimpose on the facade.

Building_base_3d: containing 
  bgrp_id: number 
  building_id: number primary key 
  geom: sdo_geometry (base solid of building)
  ... other attributes 

Building_Roof_3d: containing 
   Building_id: number primary key,
   roof_colour: hex string
   geom: sdo_geometry for roof
   the roof (SDO_GEOMETRY) of each building,

Building_facade_3d: containing 
   building_id: number 
   facade_id : number primary key 
   geom: sdo_geometry for facade 
   texture: image (BLOB storing a jpg etc) for facade


Setup:
  1. Add utl_file_dir=<current_directory_where_kmzfiles_are_written> in
     init.ora. Restart the database.
  2. Run scripts.sql to load additional pl/sql utility functions
   
SDOToKMZ.java:  Compile with sdoapi.jar, sdotype.jar, sdoutl.jar in 
   $ORACLE_HOME/md/jlib and ojdbc5.jar, xmlparserv2.jar in 
   $ORACLE_HOME/lib 


start.sh (unix), start.bat (windows): This shell script has the 
   required command to run the compiled SDOToKMZ program.
   Note that you may want to edit the connection parameters.
   Also the file_paths directory is the (current) directory 
   you want to put your image files (same as the utl_file_dir
   in init.ora)

   Run as ./start.sh (unix) or start.bat (windows)

Output:
The program outputs the doc.kml which can be viewed in Google Earth.
The doc.kml has references to kmz files, one each for each building_group
in the database.  
